package com.csf.config;

public class likeKeyConfig {

    private static final String SPLTE = ":";
    private static final String KEY_PREFIX_NAME = "like:entity";
    private static final String PREFIX_LIKE_USER = "like:user";
//    验证码
    private static final String PREFIX_KAPTCHA="kaptcha";
//    登录凭证
    private static final String PREFIX_TICKET = "ticket";
//    用户
    private static final String PREFIX_USER = "user";
//    UA
    private static final String PREFIX_UA = "ua";
//    DAU
    private static final String PREFIX_DAU = "dau";

//   热点排行
    private static final String PREFIX_POST = "post";

//    实体的赞(主键名)  set集合：key:filed,value
    public static final String getKeyName(int entityType,int entityId){
        return KEY_PREFIX_NAME+SPLTE+entityType+SPLTE+entityId;
    }
//    当前用户下总的点赞数
    public static final String getLikeUserName(int userId){
        return PREFIX_LIKE_USER+SPLTE+userId;
    }
//    验证码key名设置，因为输入验证吗操作时，不知道当前登录用户是谁，所以我们利用随机数进行标明，然后将获得的键名放入浏览器端，当登录提交数据时
//    进行验证码匹配，匹配的数据就是从cookie中将随机数拿出来，然后在redis中进行匹配验证码是否相等
    public static final String getCaptchaName(String indetiCount){
       return PREFIX_KAPTCHA+SPLTE+indetiCount;
    }

//    获取登录凭证
    public static final String getTicket(String ticket){
        return PREFIX_TICKET+SPLTE+ticket;
    }

//    将用户放入缓存中
    public static final String getUser(int userId){
        return PREFIX_USER+SPLTE+userId;
    }

//   UA
    public static final String getUAkey(String date){
        return PREFIX_UA+SPLTE+date;
    }
//    查询时间区间的访问量
    public static final String getUAkey(String start,String end){
        return PREFIX_UA+SPLTE+start+SPLTE+end;
    }
//    DAU
    public static final String getDAUkey(String date){
        return PREFIX_DAU+SPLTE+date;
    }
//   查询时间区间的用户签到
    public static final String getDAUkey(String start,String end){
        return PREFIX_DAU+SPLTE+start+SPLTE+end;
    }

//  获取热点分数的键
    public static final String getPostKey(){
        return PREFIX_POST+SPLTE+"score";
    }
}
